// 投资相关的通用类型定义

// 基础资产信息
export interface AssetInfo {
  code: string;
  name: string;
  currentPrice: number;
  maxDrawdown: number;
  type?: string;
  currency?: string;
}

// Stock信息（继承自基础资产信息）
export interface StockInfo extends AssetInfo {
  type: 'STOCK'|'ETF';
}

// 基金信息（继承自基础资产信息）
export interface FundInfo extends AssetInfo {
  type: '基金';
}

// 投资策略类型
export type StrategyType = 'equal' | 'pyramid' | 'aggressive';

// 投资配置
export interface InvestmentConfig {
  totalAmount: number;
  buyTimes: number;
  strategy: StrategyType;
  riskLevel?: number;
}

// 买入点信息
export interface BuyPoint {
  order: number;
  targetPrice: number;
  buyAmount: number;
  shares: number;
  priceDropPercent: number;
  triggerCondition: string;
}

// Stock买入点信息（包含实际金额和份额差异）
export interface StockBuyPoint extends BuyPoint {
  targetAmount: number;
  actualAmount: number;
  amountDifference: number;
}

// 风险分析
export interface RiskAnalysis {
  maxLoss: number;
  breakEvenPrice: number;
  riskLevel: string;
}

// 基础投资计划
export interface InvestmentPlan {
  config: InvestmentConfig;
  buyPoints: BuyPoint[];
  totalInvestment: number;
  expectedShares: number;
  averagePrice: number;
  riskAnalysis: RiskAnalysis;
}

// Stock投资计划
export interface StockInvestmentPlan {
  stockInfo: StockInfo;
  config: InvestmentConfig;
  buyPoints: StockBuyPoint[];
  totalInvestment: number;
  totalShares: number;
  averagePrice: number;
  targetAmount: number;
  amountDifference: number;
  riskAnalysis: RiskAnalysis;
}

// 基金投资计划
export interface FundInvestmentPlan extends InvestmentPlan {
  fundInfo: FundInfo;
}

// 投资效率指标
export interface EfficiencyMetrics {
  shareAdvantage: number;
  costAdvantage: number;
  executionComplexity: string;
  amountDeviationRate?: number;
}

// 基金搜索结果
export interface FundSearchResult {
  code: string;
  name: string;
  type: string;
  pinyin: string;
  fullName: string;
}

// 基金详情
export interface FundDetail {
  code: string;
  name: string;
  currentPrice: number;
  previousPrice: number;
  changePercent: number;
  updateTime: string;
  type: string;
}

// 基金历史数据
export interface FundHistoryData {
  maxDrawdown: number;
  dataSource: string;
  period: string;
}